package com.skytech.component.monitor.data;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface HistoryPointDAO extends JpaRepository<HistoryPoint,String> {
    List<HistoryPoint> findByEntName(String entName);

    @Transactional
    @Modifying
    @Query("update HistoryPoint a set a.time = ?1 where a.entName = ?2")
    int updateTime(String time, String entName);
}
